package org.clockworkmages.games.anno1186.gui;

import java.awt.Button;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JPanel;

import org.clockworkmages.games.anno1186.situations.gameoptions.options.GameMenuOption;
import org.clockworkmages.games.anno1186.situations.inventory.options.InventoryOption;
import org.clockworkmages.games.anno1186.situations.sexsettings.options.SexSettingsOption;
import org.clockworkmages.games.anno1186.situations.status.options.CharacterStatusOption;

public class GeneralOptionsPanel
		extends JPanel implements ActionListener {

	private static final String AC_INVENTORY = "Inventory";
	private static final String AC_STATUS = "Status";
	private static final String AC_SEXSETTINGS = "Sex Settings";
	private static final String AC_GAME_MENU = "Game Menu";

	public GeneralOptionsPanel() {
		this.setOpaque(false);

		Button button;
		button = new Button("Inventory");
		button.setActionCommand(AC_INVENTORY);
		button.addActionListener(this);
		button.setFocusable(false);
		this.add(button);

		button = new Button("Status");
		button.setActionCommand(AC_STATUS);
		button.addActionListener(this);
		button.setFocusable(false);
		this.add(button);

		button = new Button("Settings");
		button.setActionCommand(AC_SEXSETTINGS);
		button.addActionListener(this);
		button.setFocusable(false);
		this.add(button);

		button = new Button("Game Menu");
		button.setActionCommand(AC_GAME_MENU);
		button.addActionListener(this);
		button.setFocusable(false);
		this.add(button);
	}

	@Override
	public void actionPerformed(ActionEvent e) {
		switch (e.getActionCommand()) {
		case AC_INVENTORY:
			InventoryOption.INSTANCE.select();
			break;
		case AC_STATUS:
			CharacterStatusOption.INSTANCE.select();
			break;
		case AC_SEXSETTINGS:
			SexSettingsOption.INSTANCE.select();
			break;
		case AC_GAME_MENU:
			GameMenuOption.INSTANCE.select();
			break;
		}

	}

}
